// WorkerNode.js
function WorkerNode() {
  const net = require("net");
  const socket = new net.Socket();
  const port = 8000;
  const hostname = "127.0.0.1";
  socket.setEncoding = "UTF-8";
  socket.connect(port, hostname, function () {
    socket.write("connected");
  });
  socket.on("data", function (msg) {
    console.log(msg.toString('utf-8'));
  });
  socket.on("error", function (error) {
    console.log("error" + error);
  });
  socket.on("close", function () {
    console.log("closed");
  });
}
module.exports=WorkerNode